package com.vandytrack.android.servlet;


/** VanLocation container holds all data which will be
 * 	sent across the network to the server.
 * 
 * @author Demetri Miller
 **/

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class VanLocation {
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	String vehicleID = "asdf";
	
	//***** Data Members *****
	
	@Persistent
	int driverID;
	
	// Location attributes.
	@Persistent
	private float accuracy;
	@Persistent
	private double altitude;
	@Persistent
	private float bearing;
	@Persistent
	private double latitude;
	@Persistent
	private double longitude;
	@Persistent
	private float speed;
	@Persistent
	private long time;
	// ***** End Data Members *****
	
	// Default ctor.
	public VanLocation() {
		
	}
	
	// Copy ctor.
	public VanLocation(VanLocation loc) {
		this.driverID = loc.driverID;
		this.accuracy = loc.accuracy;
		this.altitude = loc.altitude;
		this.bearing = loc.bearing;
		this.latitude = loc.latitude;
		this.longitude = loc.longitude;
		this.speed = loc.speed;
		this.time = loc.time;
	}

	// Takes the driverID and location object passed and updates the
	// current object.
	public void setValues(int driverID, float accuracy, double altitude, float bearing, 
			double latitude, double longitude,
			float speed, long time) {
		this.driverID = driverID;
		this.accuracy = accuracy;
		this.altitude = altitude;
		this.bearing = bearing;
		this.latitude = latitude;
		this.longitude = longitude;
		this.speed = speed;
		this.time = time;
	}
	
	// ***** Getters and Setters for member vars *****
	
	public long getDriverID() {
		return driverID;
	}
	
	public void setDriverID(int userID) {
		this.driverID = userID;
	}

	public float getAccuracy() {
		return accuracy;
	}

	public void setAccuracy(float accuracy) {
		this.accuracy = accuracy;
	}
	
	public double getAltitude() {
		return altitude;
	}

	public void setAltitude(double altitude) {
		this.altitude = altitude;
	}

	public float getBearing() {
		return bearing;
	}

	public void setBearing(float bearing) {
		this.bearing = bearing;
	}

	public double getLatitude() {
		return latitude;
	}

	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	public double getLongitude() {
		return longitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	public float getSpeed() {
		return speed;
	}

	public void setSpeed(float speed) {
		this.speed = speed;
	}

	public long getTime() {
		return time;
	}

	public void setTime(long time) {
		this.time = time;
	}

	// ***** End Getters and Setters *****
	
	
}
